<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/public.css">
    <link rel="stylesheet" href="./css/register.css">
</head>

<body>

    <div class="enter">
        <div class="enter-left">
            <h5>
                <span class="float_left">欢迎登陆</span>
                <img src="./images/fila_blue_150.png" alt="" class="flaot_rigth">
            </h5>
            <ul>
                <li class="float_left nav_li">账号密码登陆</li>
                <li class="float_left nav_li">短信快捷登陆/注册</li>
            </ul>
            <div class="cipher" style="display: block;">
                <input type="text" placeholder="手机号码" class="cellP"><br>
                <input type="password" placeholder="登陆密码" class="logIn">
                <button class="cipher_btn"><a href="/shopping.html">立即登陆</a></button>
            </div>
            <div class="cipher">
                <input type="text" placeholder="手机号码" class="cellP"><br>
                <input type="password" placeholder="短信验证码" class="logIn">
                <button class="cipher_btn"><a href="/shopping.html" style="color: #fff;">立即登陆</a></button>
            </div>
            <p><a href="">忘记密码?</a></p>
        </div>
        <div class="enter-right">
            <h2>加入FILA V.I.P.</h2>
            <p>注册成为会员并完善个人信息，即可享受 ：</p>
            <ol>
                <li>积分可在官网购物时作为现金抵扣；</li>
                <li>官网、门店消费共享会员权益和积分累计；</li>
                <li>即时收到优惠及新品发布信息，品牌活动邀约</li>
            </ol>
            <a href="/login.html" title="立即注册" class="enter_btn">立即注册</a>
        </div>
    </div>
    <!-- 底部 -->
    <div id="foot">
        <div class="foot-wrap">
            <ul class="float_left">
                <li><a href="">购物服务</a></li>
                <li><a href="">关于品牌</a></li>
                <li><a href="">查找门店</a></li>
                <li>关注FLIA官方媒体:
                    <a href="" class="microblog"></a>
                    <a href="" class="WeChat"></a>
                </li>
                <li>售后服务电话：400-886-7699</li>
            </ul>
            <div class="foot_right float_right">
                <p>©FILA体育 闽ICP备11020421号-8 闽公网安备35020302033807号</p>
                <p>©2020 FILA Luxembourg S.à.r.l. - All Rights Reserved -</p>
            </div>
        </div>
    </div>
    <div class="service">
        <a href="">客服</a>
    </div>
    <script src="./js/jquery.min.js"></script>
    <script>
        $(function(){
            // 登陆方式
            let liList = $(".enter-left ul li")
            let cipherList = $(".enter-left div")
            liList.click(function(){
                cipherList.hide()
                cipherList.eq($(this).index()).fadeIn()
            })

            $(".cipher_btn").click(function(){
                let tel = $(".cellP").val()
                let paw =$(".logIn").val()
                $.ajax({
                    url:"http://127.0.0.1:81/userData",
                    data:{
                        tel:tel,
                        paw:paw
                    },
                    success:function(data){
                        let newData = JSON.parse(data)
                        console.log(newData)
                        if(newData.length !== 0) {
                            newData.forEach(item => {
                                if(paw){
                                    if(item.paw == paw){
                                        alert("成功")
                                    }
                                    else{
                                        alert("密码错了")
                                    }
                                }
                            });
                        }else{
                            alert("没有该用户请注册")
                        }
                    }

                })
            })
        })
    </script>
</body>

</html>